home *** CD-ROM | disk | FTP | other *** search
/ AOL File Library: 4,401 to 4,500 / aol-file-protocol-4400-4401-to-4500.zip / AOLDLs / PDA-Newton Development / ND Date & Time Editors / date.sit / dateTime.π.text < prev    next >
Text File  |  1994-10-25  |  21KB  |  783 lines

  1. DEFCONST('kDateFormat,GetDateStringSpec([
  2.                 [kElementMonth, kFormatAbbr],
  3.         [kElementYear,  kFormatLong],
  4.                 [kElementDay, kFormatLong]]));
  5.  
  6. // ---- End Project Data ----
  7.  
  8.  
  9. // ---- File test.t ----
  10. main :=
  11.    {title: "Date Protos Sample 2",
  12.     viewBounds: {left: 0, top: 25, right: 234, bottom: 310},
  13.     viewFormat: 83951953,
  14.     _proto: protoApp,
  15.     debug: "main"
  16.    };
  17.  
  18. _view000 := /* child of main */
  19.    {
  20.     text:
  21.       "\u00A9\u 1994 Atomic Software.  All rights reserved.\n\nFree to distribute and use in your apps!  Just let me know you are using it and if you enhance it.\n\nThanks\n   Allan Marcus\n\nCIS: 76666,2113\nAppleLink: allan.marcus\neWorld/NewtonMail: allan.m\nInterNet: allan@apple.com\n\n* This is a modified version of Allan's original that he sent to me. See the readme for the changes that I made to it. - Hardy Macia"
  22.     ,
  23.     viewBounds: {left: 1, top: 14, right: 237, bottom: 234},
  24.     viewJustify: 0,
  25.     _proto: protoStaticText
  26.    };
  27.  
  28.  
  29.  
  30.  
  31. // ---- File protoDateTimePicker ----
  32.  
  33. // ---- File protoFloatDragNGo ----
  34. _userproto000 :=
  35.    {viewBounds: {left: 0, top: 0, right: 10, bottom: 10},
  36.     viewFlags: 576,
  37.     viewClickScript:
  38.       func(unit)
  39.       begin
  40.          // only allow a drag to occur if it is in
  41.          // the margin of the view
  42.       
  43.          // NOTE, all cooridnates are in GLOBAL space
  44.        
  45.          // otherwise, pass clicks through to my children
  46.          local x := GetPoint(firstX, unit),
  47.                y := GetPoint(firstY, unit),
  48.                box := base:GlobalBox() ;
  49.        
  50.        
  51.          if  (y - box.top) < 10
  52.             OR   (box.bottom - y) < 10
  53.             OR   (x - box.left) < 10
  54.             OR   (box.right - x) < 10 then
  55.          begin
  56.             InkOff(unit);
  57.             base:Drag(unit, nil);
  58.             self:Dirty();// to get ink dropping up
  59.       
  60.             // return true to say handled the click
  61.             true;
  62.          end else
  63.             // return nil so kids can get click
  64.             nil;
  65.       end,
  66.     declareSelf: 'base,
  67.     viewJustify: 80,
  68.     _proto: protoFloatNGo
  69.    };
  70.  
  71.  
  72. // ---- Back in File protoDateTimePicker ----
  73. DateTimeView :=
  74.    {viewFlags: 576,
  75.     viewBounds: {left: 0, top: 0, right: 224, bottom: 148},
  76.     OpenMe:
  77.       func(returnView, myDate, myTitle)
  78.       begin
  79.           self.viewToSet := returnView;
  80.           self.theDate:= myDate;
  81.           self.theTitle := myTitle;
  82.           self:Open();
  83.       //    print("Open me done")
  84.       end,
  85.     selectedDates: [],
  86.     theDate: nil,
  87.     theTitle: "test",
  88.     title: "clMonthView Sample",
  89.     viewSetupFormScript:
  90.       func()
  91.       begin
  92.       
  93.           if not theDate or not StringToDate(theDate) then 
  94.               theDate:= time();
  95.           else
  96.               theDate := StringToDate(theDate);
  97.           
  98.           selectedDates := [theDate];
  99.           
  100.           if date(theDate).hour<12 then ampm.clusterValue:=0;
  101.           else ampm.clusterValue:=1;
  102.           
  103.           setvalue(pickerTitle, 'title, theTitle);
  104.           
  105.       end,
  106.     viewToSet: nil,
  107.     Update:
  108.       func(returnView, myDate, myTitle)
  109.       begin
  110.           self.viewToSet := returnView;
  111.           self.theDate:= myDate;
  112.           self.theTitle := myTitle;
  113.       //    self:viewSetUpFormScript();
  114.           if not theDate or not StringToDate(theDate) then 
  115.               theDate:= time();
  116.           else
  117.               theDate := StringToDate(theDate);
  118.           
  119.           selectedDates := [theDate];
  120.       
  121.           clock.hours := (theDate DIV 60) mod 24;
  122.           clock.minutes :=theDate MOD 60;
  123.           clock:dirty();
  124.           clock:setTime();
  125.       
  126.           if date(theDate).hour<12 then ampm:setClusterValue(0);
  127.           else ampm:setClusterValue(1);
  128.           
  129.           setvalue(pickerTitle, 'title, theTitle);
  130.       
  131.           datePicker:Refresh();
  132.           print("datetime updated")
  133.       end,
  134.     AutoClose: True,
  135.     _proto: _userproto000,
  136.     debug: "DateTimeView"
  137.    };
  138.  
  139.  
  140. // ---- File protoDatePicker ----
  141. protoDatePicker :=
  142.    {viewFlags: 1,
  143.     viewFormat: nil,
  144.     viewBounds: {left: 0, top: 0, right: 120, bottom: 100},
  145.     monthChangedScript:
  146.       func()
  147.       begin
  148.           // This will be inherited by the child month view and called every time
  149.           // the user taps on a new day.  It *must* be here because the user can
  150.           // tap on days at the end or beginning of the previous or next month
  151.           // (the blank spaces on the view) and actually change the date!
  152.           // If this script isn't here to update the view and the title string,
  153.           // the month with change but the display won't--confusing the heck out of
  154.           // people.
  155.           :Dirty();
  156.           :SetTitle();
  157.       end,
  158.     monthYearSpec:
  159.       GetDateStringSpec([
  160.               [kElementMonth, kFormatLong],
  161.               [kElementYear,  kFormatLong]]),
  162.     SetTitle:
  163.       // This function updates the month/year label.  It should be called
  164.       // whenever the user changes the date.
  165.       
  166.       func()
  167.       begin
  168.           SetValue(monthYearLabel, 'text,
  169.                    LongDateStr(selectedDates[0], monthYearSpec));
  170.       end,
  171.     viewSetupDoneScript:
  172.       func()
  173.       begin
  174.           if NOT selectedDates exists then
  175.               self.selectedDates := [Time()];  // initialize selectedDates to current
  176.           :SetTitle();
  177.       end,
  178.     Refresh:
  179.       // This allows scripts outside the proto to have a nice entry point for
  180.       // getting the picker refreshed when the selectedDates array changes.
  181.       
  182.       func()
  183.       begin
  184.           monthView:Dirty();
  185.           :SetTitle();
  186.       end,
  187.     viewclass: 74,
  188.     debug: "protoDatePicker"
  189.    };
  190.  
  191. monthYearLabel := /* child of protoDatePicker */
  192.    {text: "",
  193.     viewBounds: {left: 0, top: 0, right: 0, bottom: 15},
  194.     viewFlags: 3,
  195.     viewJustify: 8388662,
  196.     _proto: protoStaticText,
  197.     debug: "monthYearLabel"
  198.    };
  199. // View monthYearLabel is declared to protoDatePicker
  200.  
  201.  
  202.  
  203. previousMonthButton := /* child of protoDatePicker */
  204.    {viewBounds: {left: 0, top: 0, right: 15, bottom: 15},
  205.     viewSetupFormScript:
  206.       func()
  207.       begin
  208.           // initialize the icon from the system bitmap via a magic pointer.
  209.           self.icon := @325;    // leftBitmap
  210.       end,
  211.     viewFlags: 515,
  212.     viewJustify: 6,
  213.     viewFormat: 1,
  214.     buttonPressedScript:
  215.       func()
  216.       begin
  217.           // move to the previous month, and make sure the views redraw.
  218.           selectedDates[0] := IncrementMonth(selectedDates[0], -1);
  219.           monthView:dirty();
  220.           :SetTitle();
  221.       
  222.           // have to call RefreshViews because this is the buttonPressedScript,
  223.           // the view otherwise wouldn't get refreshed until the user lifted the
  224.           // pen!  If you had done this in the buttonClickScript instead, you
  225.           // could skip the RefreshViews() call.
  226.           RefreshViews();
  227.       end,
  228.     icon: nil,
  229.     _proto: protoPictureButton,
  230.     debug: "previousMonthButton"
  231.    };
  232.  
  233.  
  234.  
  235. nextMonthButton := /* child of protoDatePicker */
  236.    {icon: nil,
  237.     viewBounds: {top: 0, left: -15, right: 0, bottom: 15},
  238.     viewSetupFormScript:
  239.       func()
  240.       begin
  241.           // initialize the bitmap from the system ROMs via a magic pointer.
  242.           self.icon := @326;    // rightBitmap
  243.       end,
  244.     viewFlags: 515,
  245.     viewFormat: 1,
  246.     viewJustify: 38,
  247.     buttonPressedScript:
  248.       func()
  249.       begin
  250.           // move to the previous month, and make sure the views redraw.
  251.           selectedDates[0] := IncrementMonth(selectedDates[0], 1);
  252.           monthView:dirty();
  253.           :SetTitle();
  254.       
  255.           // have to call RefreshViews because this is the buttonPressedScript,
  256.           // the view otherwise wouldn't get refreshed until the user lifted the
  257.           // pen!  If you had done this in the buttonClickScript instead, you
  258.           // could skip the RefreshViews() call.
  259.           RefreshViews();
  260.       end,
  261.     _proto: protoPictureButton,
  262.     debug: "nextMonthButton"
  263.    };
  264.  
  265.  
  266.  
  267. monthView := /* child of protoDatePicker */
  268.    {viewBounds: {top: 15, left: 1, right: -1, bottom: -1},
  269.     viewFlags: 513,
  270.     viewFormat: nil,
  271.     labelFont: ROM_fontSystem9Bold,
  272.     dateFont: ROM_fontSystem9,
  273.     viewJustify: 246,
  274.     singleDay: true,
  275.     viewclass: 80,
  276.     debug: "monthView"
  277.    };
  278. // View monthView is declared to protoDatePicker
  279.  
  280.  
  281.  
  282.  
  283. // ---- Back in File protoDateTimePicker ----
  284. datePicker := /* child of DateTimeView */
  285.    {viewBounds: {left: 9, top: 30, right: 129, bottom: 118},
  286.     viewFormat: 336,
  287.     _proto: protoDatePicker,
  288.     debug: "datePicker"
  289.    };
  290. // View datePicker is declared to DateTimeView
  291.  
  292.  
  293.  
  294.  
  295. // ---- File protoAdjustoButton ----
  296.  
  297. // Before Script for "_userproto001"
  298. // Copyright, ⌐ 1994 Apple Computer. All rights reserved.
  299.  
  300. _userproto001 :=
  301.    {buttonHeight: 13,
  302.     textSpacer: 8,
  303.     viewSetupFormScript:
  304.       func()
  305.       begin
  306.           viewBounds := RelBounds(viewBounds.left, viewBounds.top,
  307.                    StrFontWidth(text, viewFont) + textSpacer, buttonHeight) ;
  308.       end,
  309.     viewChangedScript:
  310.       func(slot, view)
  311.       begin
  312.           inherited:?viewChangedScript(slot, view) ;
  313.           if slot = 'text then
  314.               :SyncView();            // SyncView causes the viewSetupFormScript to be called again,
  315.                                           // which sets the size based on the text.
  316.       end,
  317.     _proto: protoTextButton
  318.    };
  319.  
  320.  
  321. // ---- Back in File protoDateTimePicker ----
  322. _view001 := /* child of DateTimeView */
  323.    {text: "Today/Now",
  324.     buttonClickScript:
  325.       func()
  326.       begin
  327.           selectedDates := [Time()];
  328.           datePicker:Refresh();
  329.       
  330.           clock.hours := (Time() DIV 60) mod 24;
  331.           clock.minutes := Time() MOD 60;
  332.           clock:dirty();
  333.           clock:setTime();
  334.       
  335.           if date(Time()).hour<12 then ampm:setClusterValue(0);
  336.           else ampm:setClusterValue(1);
  337.       
  338.       end,
  339.     viewBounds: {left: 9, top: 132, right: 77, bottom: 144},
  340.     _proto: _userproto001
  341.    };
  342.  
  343.  
  344.  
  345. enter := /* child of DateTimeView */
  346.    {text: "Set",
  347.     buttonClickScript:
  348.       func()
  349.       begin
  350.           local am:=clone(getglobals().international.currentlocalebundle.timeformat.morningStr);
  351.           local pm:=clone(getglobals().international.currentlocalebundle.timeformat.eveningStr);
  352.       
  353.           if ampm.clusterValue = 0 then
  354.               x := stringtodate(longdatestr(selectedDates[0],0) && theTime.text & am);
  355.           else
  356.               x := stringtodate(longdatestr(selectedDates[0],0) && theTime.text & pm);
  357.       
  358.           viewToSet:PickedDate(x);    
  359.       //    SetValue(viewToSet, 'text, DateNTime(x));
  360.           if autoClose then :Parent():Close();
  361.       end,
  362.     viewBounds: {left: 107, top: 132, right: 161, bottom: 144},
  363.     _proto: _userproto001,
  364.     debug: "enter"
  365.    };
  366. // View enter is declared to DateTimeView
  367.  
  368.  
  369.  
  370. clock := /* child of DateTimeView */
  371.    {
  372.     timeChanged:
  373.       func()
  374.       begin
  375.           // do this so the old hands are erased...
  376.           self:Dirty();
  377.           
  378.           // this is just for fun, put your own stuff here...
  379.           //print("H:" && hours && "M:" && minutes);
  380.           
  381.           :setTime();
  382.           
  383.           
  384.           
  385.       end,
  386.     hours: 14,
  387.     minutes: 10,
  388.     viewBounds: {left: 152, top: 26, right: 216, bottom: 90},
  389.     viewSetupFormScript:
  390.       func()
  391.       begin
  392.           self.hours := (theDate DIV 60) mod 24;
  393.           self.minutes := theDate MOD 60;
  394.           self:dirty();
  395.           :setTIme();
  396.       //    print("Clock set up");
  397.       end,
  398.     SetTime:
  399.       func()
  400.       begin
  401.           local myHours:=self.hours, 
  402.                   myMinutes := self.minutes, 
  403.                   x, y, myArray;
  404.       
  405.       //print(hours&minutes);
  406.       
  407.           if GetLocale().TimeFormat.timeCycle = kCycle12 then begin    
  408.               if myHours = 0 then myHours:=12;
  409.               if myHours > 12 then myHours := myHours - 12;
  410.           end else begin
  411.               if ampm.clusterValue = 1 then begin
  412.                   if myHours < 12 then
  413.                       myHours := myHours + 12;
  414.               end else begin
  415.                   if myHours > 11 then
  416.                       myHours := myHours - 12;
  417.               end;
  418.           end;
  419.       
  420.       
  421.           y:=clone(getglobals().international.currentlocalebundle.timeformat.timeSepStr1);
  422.               
  423.               
  424.           if myMinutes < 10 then 
  425.               x:=(myHours & y & "0" & myMinutes);
  426.           else 
  427.               x:=(myHours & y & myMinutes);
  428.           
  429.           setvalue(theTime, 'text, x);
  430.       end,
  431.     _proto: protoSetClock,
  432.     debug: "clock"
  433.    };
  434. // View clock is declared to DateTimeView
  435.  
  436.  
  437.  
  438. theTime := /* child of DateTimeView */
  439.    {text: "00:00",
  440.     viewBounds: {left: 167, top: 96, right: 202, bottom: 110},
  441.     viewFont: simpleFont9,
  442.     viewJustify: 8388610,
  443.     _proto: protoStaticText,
  444.     debug: "theTime"
  445.    };
  446. // View theTime is declared to DateTimeView
  447.  
  448.  
  449.  
  450. pickerTitle := /* child of DateTimeView */
  451.    {title: "Title",
  452.     viewBounds: {left: 4, top: 7, right: 200, bottom: 23},
  453.     _proto: protoTitle,
  454.     debug: "pickerTitle"
  455.    };
  456. // View pickerTitle is declared to DateTimeView
  457.  
  458.  
  459.  
  460. ampm := /* child of DateTimeView */
  461.    {viewBounds: {left: 152, top: 110, right: 224, bottom: 126},
  462.     _proto: protoRadioCluster,
  463.     debug: "ampm"
  464.    };
  465. // View ampm is declared to DateTimeView
  466.  
  467. am := /* child of ampm */
  468.    {buttonValue: 0,
  469.     viewBounds: {left: 0, top: 0, right: 32, bottom: 13},
  470.     text: "AM",
  471.     viewSetupFormScript:
  472.       func()
  473.       begin
  474.       //    local x:=clone(getglobals().international.currentlocalebundle.timeformat.morningStr);
  475.       //    setValue(self, 'text, trimstring(x));
  476.       //    print(trimstring(x));
  477.       end,
  478.     _proto: protoRadioButton,
  479.     debug: "am"
  480.    };
  481.  
  482.  
  483.  
  484. pm := /* child of ampm */
  485.    {buttonValue: 1,
  486.     viewBounds: {left: 35, top: 0, right: 67, bottom: 13},
  487.     text: "PM",
  488.     viewSetupFormScript:
  489.       func()
  490.       begin
  491.       //    if 0 = StrLen(getglobals().international.currentlocalebundle.timeformat.eveningStr) then
  492.       //    setValue(self, 'text, trimstring(x));
  493.       //    print(trimstring(x));
  494.       end,
  495.     _proto: protoRadioButton,
  496.     debug: "pm"
  497.    };
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504. // ---- Back in File test.t ----
  505. dateTimePicker := /* child of main */
  506.    {_proto: DateTimeView, debug: "dateTimePicker"};
  507. // View dateTimePicker is declared to main
  508.  
  509.  
  510.  
  511.  
  512. // ---- File protoDateEditorInputLine ----
  513. dateEditorInputLine :=
  514.    {viewBounds: {left: 19, top: 64, right: -21, bottom: 80},
  515.     viewJustify: 8388656,
  516.     labelCommands: [],
  517.     labelClick:
  518.       func(unit)
  519.       begin
  520.           if self:TrackHilite(unit) then begin
  521.               if Visible(dateTimePicker) then 
  522.                   dateTimePicker:Close();
  523.               // I didn't want to do this, but to get the date picker to open correctly
  524.               // every time I needed to do the deferred action. 
  525.               local myView := self;
  526.               AddDeferredAction(func() begin
  527.                           // params to OpenMe are 
  528.                           //            (the view that gets the PickedDate message, 
  529.                           //            the default date to show, and 
  530.                           //            the title for the date picker view)
  531.                           dateTimePicker:OpenMe(entryLine, entryLine.text, label);
  532.                           myView:Hilite(nil);
  533.                       end,
  534.                       '[]);
  535.           end;
  536.           return(true); // say I handled the click.
  537.       end,
  538.     label: "Date",
  539.     entryFlags: 539137,
  540.     Date: nil,
  541.     textSetup:
  542.       func()
  543.           :textFormat(date);,
  544.     viewSetupDoneScript:
  545.       func()
  546.       begin
  547.           SetValue(entryLine,'viewFont,userFont10);
  548.           if Visible(dateTimePicker) then dateTimePicker:Update(entryLine, entryLine.text, label);
  549.       end,
  550.     PickedDate:
  551.       func(internalDate) 
  552.       // is called by datepicker when user taps "set" you must process 
  553.       // the internal date passed to you and display it
  554.       begin
  555.           Date := internalDate;
  556.           SetValue(entryline,'text,:textFormat(Date));
  557.       end,
  558.     textFormat:
  559.       func(duhDate)
  560.           if duhDate then
  561.               LongDateStr(duhDate,kDateFormat); 
  562.           else
  563.               "";,
  564.     viewSetupFormScript:
  565.       func() // I think I'm using this in my project that's why it is here. You can delete it.
  566.       begin
  567.       //    date := filterFromDate;
  568.       end,
  569.     viewlinespacing: 12,
  570.     textChanged:
  571.       func()
  572.           if NOT text OR StrLen(text) = 0 then 
  573.               date := nil;
  574.           else
  575.               date := StringToDate(TrimString(text));,
  576.     _proto: protoLabelInputLine,
  577.     debug: "dateEditorInputLine"
  578.    };
  579.  
  580.  
  581. // ---- Back in File test.t ----
  582. DateTimeInputLine := /* child of main */
  583.    {viewBounds: {left: 9, top: 253, right: 222, bottom: 273},
  584.     viewJustify: 8388608,
  585.     textFormat:
  586.       func(duhDate)
  587.           if duhDate then
  588.               DateNTime(duhDate);
  589.           else
  590.               "";,
  591.     label: "Date & Time",
  592.     _proto: dateEditorInputLine,
  593.     debug: "DateTimeInputLine"
  594.    };
  595.  
  596.  
  597.  
  598. DateInputLine := /* child of main */
  599.    {viewBounds: {left: 9, top: 233, right: 222, bottom: 253},
  600.     viewJustify: 8388608,
  601.     labelClick:
  602.       func(unit)  //changed dateTimePicker to datePicker
  603.       begin
  604.           if self:TrackHilite(unit) then begin
  605.               if Visible(datePicker) then 
  606.                   datePicker:Close();
  607.               // I didn't want to do this, but to get the date picker to open correctly
  608.               // every time I needed to do the deferred action. The drawback is that the
  609.               // button is unhilited right away
  610.               local myView := self;
  611.               AddDeferredAction(func() begin
  612.                           // params to OpenMe are 
  613.                           //            (the view that gets the PickedDate message, 
  614.                           //            the default date to show, and 
  615.                           //            the title for the date picker view)
  616.                           datePicker:OpenMe(entryLine, entryLine.text, label);
  617.                           myView:Hilite(nil); 
  618.                       end,
  619.                       '[]);
  620.           end;
  621.           return(true); // say I handled the click.
  622.       end,
  623.     viewSetupDoneScript:
  624.       func()
  625.       begin
  626.           SetValue(entryLine,'viewFont,userFont10);
  627.           if Visible(datePicker) then datePicker:Update(entryLine, entryLine.text, label); 
  628.       end,
  629.     _proto: dateEditorInputLine,
  630.     debug: "DateInputLine"
  631.    };
  632.  
  633.  
  634.  
  635.  
  636. // ---- File protoDatePickerPicker ----
  637. DateTimeView :=
  638.    {viewBounds: {left: 0, top: 0, right: 135, bottom: 133},
  639.     OpenMe:
  640.       func(returnView, myDate, myTitle)
  641.       begin
  642.           self.viewToSet := returnView;
  643.           self.theDate:= myDate;
  644.           self.theTitle := myTitle;
  645.           self:Open();
  646.       //    print("Open me done")
  647.       end,
  648.     selectedDates: [],
  649.     theDate: nil,
  650.     theTitle: "test",
  651.     title: "clMonthView Sample",
  652.     viewSetupFormScript:
  653.       func()
  654.       begin
  655.       
  656.           if not theDate or not StringToDate(theDate) then 
  657.               theDate:= time();
  658.           else
  659.               theDate := StringToDate(theDate);
  660.           
  661.           selectedDates := [theDate];
  662.           
  663.           setvalue(pickerTitle, 'title, theTitle);
  664.           
  665.       end,
  666.     viewToSet: nil,
  667.     declareSelf: 'base,
  668.     Update:
  669.       func(returnView, myDate, myTitle)
  670.       begin
  671.           self.viewToSet := returnView;
  672.           self.theDate:= myDate;
  673.           self.theTitle := myTitle;
  674.       //    self:viewSetUpFormScript();
  675.           if not theDate or not StringToDate(theDate) then 
  676.               theDate:= time();
  677.           else
  678.               theDate := StringToDate(theDate);
  679.           
  680.           selectedDates := [theDate];
  681.       
  682.           setvalue(pickerTitle, 'title, theTitle);
  683.       
  684.           datePicker:Refresh();
  685.           print("datetime updated")
  686.       end,
  687.     AutoClose: True,
  688.     _proto: _userproto000,
  689.     debug: "DateTimeView"
  690.    };
  691.  
  692. datePicker := /* child of DateTimeView */
  693.    {viewBounds: {left: 7, top: 22, right: 127, bottom: 110},
  694.     viewFormat: 336,
  695.     _proto: protoDatePicker,
  696.     debug: "datePicker"
  697.    };
  698. // View datePicker is declared to DateTimeView
  699.  
  700.  
  701.  
  702. _view002 := /* child of DateTimeView */
  703.    {text: "Today",
  704.     buttonClickScript:
  705.       func()
  706.       begin
  707.           selectedDates := [Time()];
  708.           datePicker:Refresh();
  709.       end,
  710.     viewBounds: {left: 14, top: 118, right: 65, bottom: 130},
  711.     _proto: _userproto001
  712.    };
  713.  
  714.  
  715.  
  716. enter := /* child of DateTimeView */
  717.    {text: "Set",
  718.     buttonClickScript:
  719.       func()
  720.       begin
  721.       print(selectedDates);
  722.       
  723.       viewToSet:PickedDate(selectedDates[0]);
  724.       
  725.       //    x := stringtodate(longdatestr(selectedDates[0],0));
  726.       //    SetValue(viewToSet, 'text, DateNTime(x));
  727.           if autoClose then :Parent():Close();
  728.       end,
  729.     viewBounds: {left: 73, top: 118, right: 112, bottom: 130},
  730.     _proto: _userproto001,
  731.     debug: "enter"
  732.    };
  733. // View enter is declared to DateTimeView
  734.  
  735.  
  736.  
  737. _view003 := /* child of DateTimeView */ {_proto: protoClosebox};
  738.  
  739.  
  740.  
  741. pickerTitle := /* child of DateTimeView */
  742.    {title: "Title",
  743.     viewBounds: {left: 4, top: 7, right: 200, bottom: 23},
  744.     _proto: protoTitle,
  745.     debug: "pickerTitle"
  746.    };
  747. // View pickerTitle is declared to DateTimeView
  748.  
  749.  
  750.  
  751.  
  752. // ---- Back in File test.t ----
  753. datePicker := /* child of main */ {_proto: DateTimeView, debug: "datePicker"};
  754. // View datePicker is declared to main
  755.  
  756.  
  757.  
  758. autoClose setter := /* child of main */
  759.    {
  760.     labelCommands:
  761.       ["Auto Close Date Editors on Set","Manually Close Date Editor with x"],
  762.     viewBounds: {left: 20, top: 274, right: 220, bottom: 287},
  763.     labelActionScript:
  764.       func(cmd)
  765.       begin
  766.           if cmd = 0 then 
  767.               dateTimePicker.AutoClose := datePicker.AutoClose := True;
  768.           else
  769.               dateTimePicker.AutoClose := datePicker.AutoClose := nil;
  770.       end,
  771.     _proto: protoLabelPicker,
  772.     debug: "autoClose setter"
  773.    };
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781. // ---- Beginning of section for non used Layout files ----
  782.  
  783. // End of output